-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vnet] install and run windows service #50468
Draft
nklaassen
wants to merge
5
commits into
master
Choose a base branch
from
nklaassen/windows-service
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds a Windows service for VNet. It adds support for automatically installing and running the service when the user runs `tsh vnet`, and adds a command to manually uninstall/delete the service. The service creates the TUN interface and establishes an IPC connection with the user process over a named pipe, but for now does not actually handle any networking, the rest will come in later PRs. If you want to test this out on a Windows machine/VM, you should be able to run `tsh vnet` and see that: 1. A service TeleportVNet is installed and runs `sc.exe query state=all | grep -A3 Teleport` 2. The service writes logs to `logs.txt` in the directory where `tsh` is installed (this is temporary until I find a better place for logs). 3. A TUN interface is created `netsh interface show interface` 4. The service stops and the interface is cleaned up when the user process exits. Unfortunately this PR does not include any unit tests. Most of the functionality here needs to be able to escalate to administrator with a UAC prompt and needs to run on Windows, this is exactly the kind of unit test that is very hard to write and would never actually be able to run in CI. But, any part of this that's broken would immediately break VNet on Windows, and this should be caught in any test plan.
nklaassen
added
the
no-changelog
Indicates that a PR does not require a changelog entry
label
Dec 20, 2024
cc @ravicious, I'm once again refactoring a bunch of stuff |
github-actions
bot
added
size/md
tsh
tsh - Teleport's command line tool for logging into nodes running Teleport.
labels
Dec 20, 2024
converting back to draft, i'll probably end up closing this, thinking i will switch to a COM service and a TCP socket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
no-changelog
Indicates that a PR does not require a changelog entry
size/md
tsh
tsh - Teleport's command line tool for logging into nodes running Teleport.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a Windows service for VNet. It adds support for automatically installing and running the service when the user runs
tsh vnet
, and adds a command to manually uninstall/delete the service.The service creates the TUN interface and establishes an IPC connection with the user process over a named pipe, but for now does not actually handle any networking, the rest will come in later PRs.
If you want to test this out on a Windows machine/VM, you should be able to run
tsh vnet
and see that:sc.exe query state=all | grep -A3 Teleport
logs.txt
in the directory wheretsh
is installed (this is temporary until I find a better place for logs).netsh interface show interface
Unfortunately this PR does not include any unit tests. Most of the functionality here needs to be able to escalate to administrator with a UAC prompt and needs to run on Windows, this is exactly the kind of unit test that is very hard to write and would never actually be able to run in CI.
But, any part of this that's broken would immediately break VNet on Windows, and this should be caught in any test plan.